#include <stdio.h>
#include <stdlib.h>

#define true 1
#define false 0
typedef unsigned char bool;
#define MaxSize 10
typedef struct{
    int data[MaxSize];
    int length;
}SqList;

void InitList(SqList *L){
    for(int i=0; i<MaxSize; i++){
        L->data[i] = 0; //将所有数据元素设置为默认值
    }
    L->length = 0;      //顺序表初始长度为0
}

int getElem(SqList *L,int i){
    return L->data[i-1];
}

int main(){
    SqList L;
    int e = -1;
    InitList(&L);

    printf("insert some values:111 data[0]~data[5]\n");
    for (int i = 0;i<=5;i++){
        L.data[i] = i*111;
    }
    L.length = 6;

    for (int i = 0;i<=L.length-1;i++){
        printf("data[%d] = %d\n",i,L.data[i]);
    }

    printf("get second elem = %d",getElem(&L, 2));

    return 0;
}
